<!--
 * @Descripttion: 
 * @version: 
 * @Author: wtzhang
 * @Date: 2021-05-28 16:16:52
 * @LastEditors: wtzhang
 * @LastEditTime: 2021-06-02 14:09:41
-->
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark" aria-label="Main navigation">
  <div class="container-fluid">
    <a class="navbar-brand" href="/">
      <img style="width: 110px" src="/public/image/logo.png" alt="">
    </a>
    <div>
      <ul class="nav navbar-nav navbar-right">
        {{ if user }}
        <div class="btn-group" style="right: 10%;">
          <a class="btn btn-success" href="/topics/new">发表</a>
        </div>
        <li class="dropdown" style="right: 20%;">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
            <img width="30" height="30" style="border-radius: 50%;" src="../public/img/avatar-default.png" alt=""> 
            <span class="caret"></span>
          </a>
          <ul class="dropdown-menu">
            <li class="dropdown-current-user">
              当前登录用户: {{ user.nickname }}
            </li>
            <li role="separator" class="divider"></li>
            <li><a href="#">个人主页</a></li>
            <li><a href="/settings/profile">设置</a></li>
            <li><a href="/logout">退出</a></li>
          </ul>
        </li>
        {{ else }}
        <div class="btn-group" style="right: 20px;">
          <a class="btn btn-primary" href="/login">登录</a>&nbsp;
          <a class="btn btn-success" href="/register">注册</a>
        </div>
        {{ /if }}
      </ul>
    </div>
  </div>
</nav>